package Graphe;

public class Arrete implements Comparable<Arrete>{
	private Noeud noeudDep;
	private Noeud noeudFin;
	private int cout;
	private boolean marquee = false;
	
	public Arrete(Noeud noeudDep, Noeud noeudFin, int cout) {
		this.setNoeudDep(noeudDep);
		this.setNoeudFin(noeudFin);
		this.setCout(cout);
	}
	
	public void setMarquee(boolean b) {
		this.marquee = b;
	}
	
	public boolean isMarquee() {
		return marquee;
	}

	public Arrete(int noeudDep, int noeudFin, int cout) {
		this.setNoeudDep(new Noeud(noeudDep));
		this.setNoeudFin(new Noeud(noeudFin));
		this.setCout(cout);
	}

	public Noeud getNoeudDep() {
		return noeudDep;
	}

	public void setNoeudDep(Noeud noeudDep) {
		this.noeudDep = noeudDep;
	}

	public Noeud getNoeudFin() {
		return noeudFin;
	}

	public void setNoeudFin(Noeud noeudFin) {
		this.noeudFin = noeudFin;
	}

	public int getCout() {
		return cout;
	}

	public void setCout(int cout) {
		this.cout = cout;
	}
	
	public String toString(){
		return "Arrete: Noeud dep = "+this.noeudDep.toString()+" Noeud fin = "+this.noeudFin.toString()+" Cout = "+this.getCout();
	}

	public int compareTo(Arrete o) {
		if(o.getCout() > this.getCout()){
			return -1;
		}else if(o.getCout() < this.getCout()){
			return 1;
		}else{
			return 0;
		}
	}
}
